package org.creativor.rayson.exception;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.ByteArrayOutputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.PipedInputStream;
import org.creativor.rayson.common.RpcCallException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>RpcCallExceptionTest</code> contains tests for the class
 * <code>{@link RpcCallException}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 * 
 * @generatedBy CodePro at 11-5-7 上午3:20
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class RpcCallExceptionTest {
	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(RpcCallExceptionTest.class);
	}

	/**
	 * Perform pre-test initialization.
	 * 
	 * @throws Exception
	 *             if the initialization fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Before
	public void setUp() throws Exception {
		// TODO: add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 * 
	 * @throws Exception
	 *             if the clean-up fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@After
	public void tearDown() throws Exception {
		// TODO: add additional tear down code here
	}

	/**
	 * Run the Throwable getCause() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testGetCause_1() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());

		Throwable result = fixture.getCause();

		// TODO: add additional test code here
		assertNotNull(result);
		assertEquals(null, result.getCause());
		assertEquals("java.lang.Throwable", result.toString());
		assertEquals(null, result.getMessage());
		assertEquals(null, result.getLocalizedMessage());
	}

	/**
	 * Run the boolean isInvokeException() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testIsInvokeException_1() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());

		boolean result = fixture.isInvokeException();

		// TODO: add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the boolean isInvokeException() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testIsInvokeException_2() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());

		boolean result = fixture.isInvokeException();

		// TODO: add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_1() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_10() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_11() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_2() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_3() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_4() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_5() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_6() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_7() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_8() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the void read(DataInput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test(expected = java.io.IOException.class)
	public void testRead_9() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataInput in = new DataInputStream(new PipedInputStream());

		fixture.read(in);

		// TODO: add additional test code here
	}

	/**
	 * Run the RpcCallException() constructor test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testRpcCallException_1() throws Exception {

		RpcCallException result = new RpcCallException();

		// TODO: add additional test code here
		assertNotNull(result);
		assertEquals(null, result.getCause());
		assertEquals(false, result.isInvokeException());
		assertEquals("org.creativor.rayson.exception.RpcCallException",
				result.toString());
		assertEquals(null, result.getMessage());
		assertEquals(null, result.getLocalizedMessage());
	}

	/**
	 * Run the RpcCallException(Throwable) constructor test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testRpcCallException_2() throws Exception {
		Throwable cause = new Throwable();

		RpcCallException result = new RpcCallException(cause);

		// TODO: add additional test code here
		assertNotNull(result);
		assertEquals(false, result.isInvokeException());
		assertEquals("org.creativor.rayson.exception.RpcCallException",
				result.toString());
		assertEquals(null, result.getMessage());
		assertEquals(null, result.getLocalizedMessage());
	}

	/**
	 * Run the RpcCallException(CallInvokeException) constructor test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testRpcCallException_3() throws Exception {
		CallInvokeException invokeException = new CallInvokeException(
				new Throwable());

		RpcCallException result = new RpcCallException(invokeException);

		// TODO: add additional test code here
		assertNotNull(result);
		assertEquals(true, result.isInvokeException());
		assertEquals("org.creativor.rayson.exception.RpcCallException",
				result.toString());
		assertEquals(null, result.getMessage());
		assertEquals(null, result.getLocalizedMessage());
	}

	/**
	 * Run the void write(DataOutput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testWrite_1() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());

		fixture.write(out);

		// TODO: add additional test code here
	}

	/**
	 * Run the void write(DataOutput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testWrite_2() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());

		fixture.write(out);

		// TODO: add additional test code here
	}

	/**
	 * Run the void write(DataOutput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testWrite_3() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());

		fixture.write(out);

		// TODO: add additional test code here
	}

	/**
	 * Run the void write(DataOutput) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:20
	 */
	@Test
	public void testWrite_4() throws Exception {
		RpcCallException fixture = new RpcCallException(new Throwable());
		DataOutput out = new DataOutputStream(new ByteArrayOutputStream());

		fixture.write(out);

		// TODO: add additional test code here
	}
}